package cn.gogpay.dcb.ixc.cloud.auth.dto;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.RequestMethod;

import java.io.Serializable;
import java.util.Set;

/**
 * @author: YinHeng
 * @date: 2021/2/7 11:07
 * @description: 应用信息传输对象
 */
public class AppDTO implements Serializable {

    private String name;

    private String code;

    /**
     * 状态（字典 0正常 1停用 2删除）
     */
    private Integer status;

    private String contextPath;

    private Set<ApiDTO> apiSet;

    public Set<ApiDTO> getApiSet() {
        return apiSet;
    }

    public void setApiSet(Set<ApiDTO> apiSet) {
        this.apiSet = apiSet;
    }

    public static class ApiDTO {

        private Long id;

        private Long appId;

        private Set<RequestMethod> methods;

        private String name;

        private Integer policy;

        private String url;

        private Integer pIndex;

        private Integer pValue;

        private Integer status;

        private String remark;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public Long getAppId() {
            return appId;
        }

        public void setAppId(Long appId) {
            this.appId = appId;
        }

        public Set<RequestMethod> getMethods() {
            return methods;
        }

        public void setMethods(Set<RequestMethod> methods) {
            this.methods = methods;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getPolicy() {
            return policy;
        }

        public void setPolicy(Integer policy) {
            this.policy = policy;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public Integer getpIndex() {
            return pIndex;
        }

        public void setpIndex(Integer pIndex) {
            this.pIndex = pIndex;
        }

        public Integer getpValue() {
            return pValue;
        }

        public void setpValue(Integer pValue) {
            this.pValue = pValue;
        }

        public Integer getStatus() {
            return status;
        }

        public void setStatus(Integer status) {
            this.status = status;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        @Override
        public int hashCode() {
            return super.hashCode();
        }

        @Override
        public boolean equals(Object obj) {
            return super.equals(obj);
        }

        @Override
        public String toString() {
            return JSON.toJSONString(this);
        }
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }


}
